package com.oglvip.business.remote.service.api;

import com.oglvip.business.dto.ForgetPwdFormDto;
import com.oglvip.business.dto.RegisterFormDto;
import com.oglvip.business.dto.ResponseData;
import com.oglvip.business.remote.service.Targets;
import com.oglvip.business.remote.service.entity.StoreAccount;
import com.oglvip.business.remote.support.annotation.BodyParam;
import com.oglvip.business.remote.support.annotation.RestClient;
import com.oglvip.business.remote.support.request.ContentTypes;

import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;

/**
 * @auther hanchao
 * @date 2016/12/4 4:32
 */
@RestClient(Targets.PLATFORM_API)
@Path("/api/store/account")
public interface StoreAccountService {
    @POST
    @Path("/login")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData<StoreAccount> login(@FormParam("phone") String phone, @FormParam("password") String password);

    @POST
    @Path("/password/modify")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData modifypwd(@FormParam("ticket") String ticket, @FormParam("oldPassword") String oldPass,@FormParam("newPassword")String newPass);

    @POST
    @Path("/password/forget")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData forgetPwd(@BodyParam ForgetPwdFormDto dto);

    @POST
    @Path("/register")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData register(@BodyParam RegisterFormDto dto);



    //验证码相关

    /**
     *
     * @param phone
     * @param type 0注册 1忘记密码 2更换手机
     * @return
     */
    @POST
    @Path("/captcha/create")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData createCaptcha(@FormParam("phone") String phone,@FormParam("type")Integer type);

    @POST
    @Path("/captcha/verify")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData verifyCaptcha(@FormParam("phone") String phone,@FormParam("code")String code,@FormParam("type")Integer type);

}

